package com.xhl.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.xhl.service.PropertyValueService;
import com.xhl.vo.PropertyValueVO;

@Controller
@RequestMapping("/propertyValue")
public class PropertyValueController {

    @Autowired
    PropertyValueService propertyValueServiec;

    @RequestMapping("/query")
    @ResponseBody
    public String queryPropertyValueById(HttpServletRequest req) {
        String pid = req.getParameter("pid");
        String ptid = req.getParameter("ptid");
        System.out.println(pid + "  ----  " + ptid);
        if (pid == null) {
            return "异常";
        }
        PropertyValueVO pvlist = propertyValueServiec.queryPropertyValueById(pid, ptid);

        String json = JSON.toJSONString(pvlist);
        return json;
    }
}
